package com.example.administrator.readbook.ui;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;

import com.example.administrator.readbook.R;
import com.example.administrator.readbook.base.BaseActivity;
import com.example.administrator.readbook.bean.RankingBean;
import com.example.administrator.readbook.http.ServiceFactory;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

import static com.example.administrator.readbook.http.ServiceFactory.schedulersTransformer;

public class RankingActivity extends BaseActivity {

    private List<RankingBean.RankingDetailsBean> rankingList = new ArrayList<>();

    @Override
    protected void initView(Bundle savedInstanceState) {
        setToolbar((Toolbar) findViewById(R.id.toolbar), getString(R.string.title_ranking));
    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void initLoad() {
        getRankGender();
    }

    @Override
    protected void initData(Bundle savedInstanceState) {

    }

    @Override
    protected void initLayoutView(Bundle savedInstanceState) {
        setContentView(R.layout.activity_ranking);
    }

    public void getRankGender() {
        ServiceFactory.getServiceBook().getRankGender().compose(schedulersTransformer).subscribe(new Observer<RankingBean>() {
            @Override
            public void onSubscribe(Disposable d) {

            }

            @Override
            public void onNext(RankingBean rankingBean) {
                if (rankingBean != null) {

                }
            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onComplete() {

            }
        });
    }
}
